#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : Thu Jun 06 2019
# @Author  : xujunfu (xjf891121@gmail.com})
# @Link    : http://junfuxu.github.io/
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.management.base import BaseCommand, CommandError
from rest_framework.authtoken.models import Token

from user.models import User


class Command(BaseCommand):
    help = 'Create test user'

    def handle(self, *args, **options):

        u = User.objects.create_superuser(company_id=1, username="admin",
                                          email='admin@qq.com', is_staff=True,
                                          password='123456')
        # u1 = User.objects.create_user(company_id=18,username='test_dbwl',email='dbwl@qq.com',is_staff=0,
        #                          password='123456')
        # u2 = User.objects.create_user(company_id=9,username='test_zyhb',email='zyhb@qq.com',is_staff=0,
        #                               password='123456')
        self.stdout.write(self.style.SUCCESS('Successfully closed fake user'))
